home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
fortran
/
libry51.zip
/
LIBRY2.DOC
< prev
next >
Wrap
Text File
|
1989-11-10
|
14KB
|
386 lines
.pa
GENERAL UTILITIES AND CRT CONTROL
These general utilities should work on whatever system you have (as long as it
is basically IBM compatible or an HP-1000). However, all of the CRT control
procedures will only work on PCs (80 column mode only), HP-26XXs, or Tektronix
4XXX terminals.
QUICK LIST OF GENERAL UTILITIES AND CRT CONTROL
ADATE.... fetch the date
ATIME.... fetch the time of day
BEEP..... beep
CLEAR1... clear one line on the CRT and move cursor to column 1
CPU...... fetch the time (also see SECNDS)
CRT1C.... write one character to the CRT
CRT1D.... write one dot to the CRT in graphics mode
ERASE.... clear the CRT
EXEPRG... run a program from within another program
FFPRN.... send a formfeed to the printer
FTIME.... fetch character string indicating date and time
GET1C.... read 1 character from the keyboard don't wait or display
GETPSP... get the program segment prefix (PC only - on HP use GETST)
HELPME... list help information from user-defined help file
IFBRK.... detect keyboard interrupt (if-break)
LXXX87... logical test for math coprocessor
PAUSE.... display message and wait for any keystroke
PRT1C.... send 1 character to the printer
READ1.... read 1 character from the keyboard - don't wait for RETURN
READC.... read a string from the keyboard
RRPAR.... get file name from runtime string
RS232I... RS-232 communications port I/O and control
SECNDS... fetch the time (also see CPU)
SETVM.... set video mode
SPOOL.... divert output from FFPRN and WRPRN to a file (can be NUL or CON)
TONE..... sound a tone
UP1LIN... move the cursor up 1 line on the CRT
WCGRM.... write a character in graphics mode
WRPRN.... print a character string
WRTTY.... write a character string on the CRT
.pa
NAME: ADATE
PURPOSE: fetch the date
TYPE: subroutine (far external)
SYNTAX: CALL ADATE(MONTH,IDAY,IYEAR)
OUTPUT: MONTH (INTEGER*2) month
IDAY (INTEGER*2) day of the month
IYEAR (INTEGER*2) year 1986, 1987, etc.
NAME: ATIME
PURPOSE: fetch the time of day
TYPE: subroutine (far external)
SYNTAX: CALL ATIME(IHOUR,MIN,ISEC,IHUN)
OUTPUT: IHOUR (INTEGER*2) hours in military time
MIN (INTEGER*2) minutes
ISEC (INTEGER*2) seconds
IHUN (INTEGER*2) hundredths of seconds
NAME: BEEP
PURPOSE: beep
TYPE: subroutine (far external)
SYNTAX: CALL BEEP
NAME: CLEAR1
PURPOSE: clear one line on the CRT and move cursor to column 1
TYPE: subroutine (far external)
SYNTAX: CALL CLEAR1
NAME: CPU
PURPOSE: fetch the time
TYPE: subroutine (far external)
SYNTAX: CALL CPU(SEC)
OUTPUT: SEC (REAL*4) seconds
NOTE: on the PC this returns the elapsed time since midnight
on the HP-1000F this returns cumulative session CPU
this is useful for computing runtimes
also see SECNDS
NAME: CRT1C
PURPOSE: write one character to the CRT
TYPE: subroutine (far external)
SYNTAX: CALL CRT1C(IROW,ICOL,CHAR)
INPUT: IROW (INTEGER*2) row number (0=top)
ICOL (INTEGER*2) column number (0=left)
CHAR (CHARACTER*1) character
OUTPUT: none
NAME: CRT1D
PURPOSE: write one dot to the CRT in graphics mode
TYPE: subroutine (far external)
SYNTAX: CALL CRT1D(IROW,ICOL,IDOT)
INPUT: IROW (INTEGER*2) row number (0=top)
ICOL (INTEGER*2) column number (0=left)
IDOT (INTEGER*2) color (depends on video mode)
OUTPUT: none
NAME: ERASE
PURPOSE: clear the CRT
TYPE: subroutine (far external)
SYNTAX: CALL ERASE
NAME: EXEPRG
PURPOSE: run a program from within another program
TYPE: subroutine (far external)
SYNTAX: CALL EXEPRG('d:\path\myprog.exe'//CHAR(0),
& 'string/options etc.'//CHAR(0),IER)
INPUT: program name and runtime string
OUTPUT: IER (INTEGER*2) error indicator
NAME: FFPRN
PURPOSE: send a formfeed to the printer
TYPE: subroutine (far external)
SYNTAX: CALL FFPRN
NAME: FTIME
PURPOSE: fetch character string indicating date and time
TYPE: subroutine (far external)
SYNTAX: CALL FTIME(DATE)
OUTPUT: DATE (CHARACTER*30)
NAME: GET1C
PURPOSE: read 1 character from the keyboard don't wait or display
TYPE: subroutine (far external)
SYNTAX: CALL GET1C(ANS)
OUTPUT: ANS (CHARACTER*1)
NOTE: this is very handy for creating menus - also see READ1
NAME: GETPSP
PURPOSE: get the program segment prefix (PC only - on HP use GETST)
TYPE: subroutine (far external)
SYNTAX: CALL GETPSP(PSP)
INPUT: none
OUTPUT: PSP (CHARACTER*1 PSP(128))
NOTE: This seems like a logical thing to want; but to actually find
the PSP after DOS gets through with it on the PC is no easy
task when working from inside an EXE file.
NAME: HELPME
PURPOSE: detect keyboard interrupt (if-break)
TYPE: subroutine (far external)
SYNTAX: CALL HELPME(NAME,CBUF)
INPUT: NAME (CHARACTER*12) user-defined help file name
CBUF (CHARACTER*5) key
OUTPUT: output is always to the CRT via WRTTY
NOTE: The key can be '?,xxx' or just 'xxx ' either way will do.
See example help file at the end of this section.
NAME: IFBRK
PURPOSE: detect keyboard interrupt (if-break)
TYPE: LOGICAL*2 function (far external)
SYNTAX: IF(IFBRK(0)) GO TO 100
NOTE: you must pass a dummy parameter "0" so FORTRAN will generate
the proper calling sequence
NAME: LXXX87
PURPOSE: logical test for math coprocessor
TYPE: LOGICAL*2 function (far external)
SYNTAX: IF(.NOT.LXXX87(0)) GO TO 100
NOTE: you must pass a dummy parameter "0" so FORTRAN will generate
the proper calling sequence
NAME: PAUSE
PURPOSE: display the message "hit the SPACE BAR to continue" and wait
for any keystroke
TYPE: subroutine (far external)
SYNTAX: CALL PAUSE
NOTE: you may want to follow this with CALL CLEAR1 to erase the line
NAME: PRT1C
PURPOSE: send 1 character to the printer (bypasses DOS)
TYPE: subroutine (far external)
SYNTAX: CALL PRT1C('a') or CALL PRT1C(CHAR(13))
INPUT: one CHARACTER*1 variable
NOTE: if you want to print a string use WRPRN
NAME: READ1
PURPOSE: read 1 character from the keyboard - don't wait for RETURN
TYPE: subroutine (far external)
SYNTAX: CALL READ1(ANS)
OUTPUT: ANS (CHARACTER*1)
NOTE: this is very handy for creating menus - also see GET1C
NAME: READC
PURPOSE: read a string from the keyboard
TYPE: subroutine (far external)
SYNTAX: CALL READC(CBUF,NBUF,IERR)
INPUT: NBUF (INTEGER*2) maximum number of characters to be read
OUTPUT: CBUF (CHARACTER*1 CBUF(NBUF) or CHARACTER*80 CBUF, NBUF=80)
IERR (INTEGER*2) error return indicator (IERR=0 is normal)
NOTE: This bypasses DOS (which is often advantageous). On the HP
this goes directly to the OPSYS. If you ask for 6 characters
then READC will only allow you to enter 6. The maximum number
of characters that can be requested is the 80 - the current
column (or a maximum of 79 if the cursor is at the left)
NAME: RRPAR
PURPOSE: get file name from runtime string
TYPE: subroutine (far external)
SYNTAX: CALL RRPAR(N,NAME)
INPUT: N (INTEGER*2) number of entry see example below
OUTPUT: NAME (CHARACTER*12)
NOTE: the purpose of this is to fetch and parse the string that you
type in after the name of your program as below
MYPROG this.dat that.for other.bin wednesday
fetch the names with the following
CHARACTER NAME1*12,NAME2*12,NAME3*12,COMMENT*12
CALL RRPAR(1,NAME1)
CALL RRPAR(2,NAME2)
CALL RRPAR(3,NAME3)
CALL RRPAR(4,COMMENT)
you will get the following
NAME1='this.dat'
NAME2='that.for'
NAME3='other.bin'
COMMENT='wednesday'
NAME: RS